package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingProfessionalMapper;
import com.ruoyi.teaching.domain.TeachingProfessional;
import com.ruoyi.teaching.service.ITeachingProfessionalService;

/**
 * 专业信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingProfessionalServiceImpl implements ITeachingProfessionalService 
{
    @Autowired
    private TeachingProfessionalMapper teachingProfessionalMapper;

    /**
     * 查询专业信息
     * 
     * @param professionalId 专业信息主键
     * @return 专业信息
     */
    @Override
    public TeachingProfessional selectTeachingProfessionalByProfessionalId(Long professionalId)
    {
        return teachingProfessionalMapper.selectTeachingProfessionalByProfessionalId(professionalId);
    }

    /**
     * 查询专业信息列表
     * 
     * @param teachingProfessional 专业信息
     * @return 专业信息
     */
    @Override
    public List<TeachingProfessional> selectTeachingProfessionalList(TeachingProfessional teachingProfessional)
    {
        return teachingProfessionalMapper.selectTeachingProfessionalList(teachingProfessional);
    }

    /**
     * 新增专业信息
     * 
     * @param teachingProfessional 专业信息
     * @return 结果
     */
    @Override
    public int insertTeachingProfessional(TeachingProfessional teachingProfessional)
    {
        teachingProfessional.setCreateTime(DateUtils.getNowDate());
        return teachingProfessionalMapper.insertTeachingProfessional(teachingProfessional);
    }

    /**
     * 修改专业信息
     * 
     * @param teachingProfessional 专业信息
     * @return 结果
     */
    @Override
    public int updateTeachingProfessional(TeachingProfessional teachingProfessional)
    {
        teachingProfessional.setUpdateTime(DateUtils.getNowDate());
        return teachingProfessionalMapper.updateTeachingProfessional(teachingProfessional);
    }

    /**
     * 批量删除专业信息
     * 
     * @param professionalIds 需要删除的专业信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingProfessionalByProfessionalIds(Long[] professionalIds)
    {
        return teachingProfessionalMapper.deleteTeachingProfessionalByProfessionalIds(professionalIds);
    }

    /**
     * 删除专业信息信息
     * 
     * @param professionalId 专业信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingProfessionalByProfessionalId(Long professionalId)
    {
        return teachingProfessionalMapper.deleteTeachingProfessionalByProfessionalId(professionalId);
    }
}
